import java.util.Random;

public class demo11 {
    public static void main(String[] args) {
//        int a=(int)(Math.random()*(10000))-(5000);
        int[] a = new int[100001];
        for (int i = 0; i < 1000; i++) {
            int mm = (int)(Math.random()*100001);
            a[mm] += mm-(mm-1);
        }
        for (int i = 0; i <a.length ; i++) {
            if (a[i] !=0) {
                System.out.println("出现次数:"+a[i] + "\t具体数值:"+(i-50000));
            }
        }

    }
}
